package capricornus.components.button
{
	import capricornus.components.singleselectgroup.SingleSelectGroup;

	public class RadioButton extends CheckBox
	{
		private var _group:SingleSelectGroup;
		
		public function RadioButton()
		{
			super();
		}
		
		public function set group( value:SingleSelectGroup ):void
		{
			if( _group != null ) _group.removeItem( this );
			_group = value;
			if( _group != null ) _group.addItem( this );
		}
		
		override public function destroy():void
		{
			if( _group != null ) _group.removeItem( this );
			_group = null;
		}
		
		override protected function setSkinClass():void
		{
			_disabledSkinClass = RadioButton_disabledIcon;
			_upSkinClass = RadioButton_upIcon;
			_overSkinClass = RadioButton_overIcon;
			_downSkinClass = RadioButton_downIcon;
		}
		
		override protected function get selectClass():Class
		{
			return RadioButton_selectedIcon;
		}
	}
}